home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / ld / testsuite / ld-scripts / sizeof.exp < prev    next >
Encoding:
Text File  |  1996-07-04  |  1.4 KB  |  56 lines

  1. # Test SIZEOF in a linker script.
  2. # By Ian Lance Taylor, Cygnus Support
  3. # Based on a bug report from anders.blomdell@control.lth.se.
  4.  
  5. set testname "SIZEOF"
  6.  
  7. if ![ld_assemble $as $srcdir$subdir/sizeof.s tmpdir/sizeof.o] {
  8.     unresolved $testname
  9.     return
  10. }
  11.  
  12. if ![ld_simple_link $ld tmpdir/sizeof "-T $srcdir$subdir/sizeof.t tmpdir/sizeof.o"] {
  13.     fail $testname
  14.     return
  15. }
  16.  
  17. if ![ld_nm $nm tmpdir/sizeof] {
  18.     unresolved $testname
  19.     return
  20. }
  21.  
  22. if {![info exists nm_output(text_start)] \
  23.      || ![info exists nm_output(text_end)] \
  24.      || ![info exists nm_output(data_start)] \
  25.      || ![info exists nm_output(data_end)] \
  26.      || ![info exists nm_output(sizeof_text)] \
  27.      || ![info exists nm_output(sizeof_data)]} {
  28.     send_log "bad output from nm\n"
  29.     verbose "bad output from nm"
  30.     fail $testname
  31.     return
  32. }
  33.  
  34. if {$nm_output(text_end) - $nm_output(text_start) != $nm_output(sizeof_text)} {
  35.     send_log "text_end - text_start != sizeof_text\n"
  36.     verbose "text_end - text_start != sizeof_text"
  37.     fail $testname
  38.     return
  39. }
  40.  
  41. if {$nm_output(data_end) - $nm_output(data_start) != $nm_output(sizeof_data)} {
  42.     send_log "data_end - data_start != sizeof_data\n"
  43.     verbose "data_end - data_start != sizeof_data"
  44.     fail $testname
  45.     return
  46. }
  47.  
  48. if {$nm_output(sizeof_text) != $nm_output(sizeof_data)} {
  49.     send_log "sizeof_text != sizeof_data\n"
  50.     verbose "sizeof_text != sizeof_data"
  51.     fail $testname
  52.     return
  53. }
  54.  
  55. pass $testname
  56.